<?php

include 'DAO/UserDao.class.php';

session_start();
$currentLocation = trim(strip_tags($_GET['currentLocation']));

if(isset($_SESSION['login'])){
    if($_SESSION['login']){
        $loggedUser = $_SESSION['userId'];
        $userDao = new UserDAO();
        $userDao ->updateCurrentLocation($loggedUser, $currentLocation);
        header("Location: user.php?$loggedUser#future");
    }
    else{
        header('Location: index.php');
    }
}
else{
        header('Location: index.php');
}

?>
